package org.bigk.invoices.model.builder;

import org.bigk.invoices.model.Purchaser;

public class PurchaserBuilder {

	private Long id;
	private String name;
	private String address;
	private String nip;

	private PurchaserBuilder() {}
	
	public PurchaserBuilder withId(Long id) {
		this.id = id;
		return this;
	}

	public PurchaserBuilder withName(String name) {
		this.name = name;
		return this;
	}

	public PurchaserBuilder withAddress(String address) {
		this.address = address;
		return this;
	}

	public PurchaserBuilder withNip(String nip) {
		this.nip = nip;
		return this;
	}

	public Purchaser build() {
		Purchaser purchaser = new Purchaser();
		purchaser.setId(this.id);
		purchaser.setName(this.name);
		purchaser.setAddress(this.address);
		purchaser.setNip(this.nip);
		return purchaser;
	}
	
	public static PurchaserBuilder aPurchaser() {
		return new PurchaserBuilder();
	}
}
